package cc.git.liuyan.test;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.edge.EdgeOptions;

public class BaiDu_Test_1 {
    public static void main(String[] args) {
        System.setProperty("webdriver.edge.driver", "E:\\edgeDriver\\msedgedriver.exe");
        EdgeOptions edgeOptions = new EdgeOptions();
        //edgeOptions.addArguments("--headless"); //无头模式
        WebDriver driver = new EdgeDriver(edgeOptions);
        driver.get("https://www.baidu.com");
        //
        driver.findElement(By.id("kw")).sendKeys("selenium");

        System.out.println(driver.findElement(By.id("su")).getAttribute("value"));

        driver.findElement(By.id("su")).click();

//        driver.quit(); //退出关闭
        System.out.println("Hello, World!");
    }
}